package com.yunchao.library.socket.extensions

import java.nio.ByteBuffer
import java.nio.ByteOrder

fun ByteArray.toReadOnlyBuffer(): ByteBuffer {
    return ByteBuffer.wrap(this).order(ByteOrder.BIG_ENDIAN)
}

val ByteArray.hexString: String
    get() = joinToString("") { "%02X".format(it) }

